package com.bestbuy.controller;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.bestbuy.pojo.Product;
import com.bestbuy.service.ProductService;
import com.bestbuy.serviceimple.ProductServiceImpl;


@Controller
@RequestMapping("/")
public class IndexController
{
	@Autowired
	private ProductService productService;
	
	@RequestMapping(value = {"/index",""})
	public String getListSanPham(Model model)
	{
		
		List<Product> product = productService.getListProduct();
		model.addAttribute("product",product);
		model.addAttribute("Page", "Index");
		return "Main";
	}
}
